<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	Integer pageSize = (Integer) request.getAttribute("pageSize");
	Integer pageNum = (Integer) request.getAttribute("pageNum");
	Long total = (Long) request.getAttribute("total");
	String searchType = (String) request.getAttribute("searchType") == null
			? "1"
			: (String) request.getAttribute("searchType");
	String searchValue = (String) request.getAttribute("searchValue") == null
			? ""
			: (String) request.getAttribute("searchValue");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<%@include file="/public/head.jspf"%>
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="${dailySupport}/css/bootstrap.min.css">
<link rel="stylesheet"
	href="${dailySupport}/css/public/paging/paging.css">
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="${dailySupport}/js/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="${dailySupport}/js/bootstrap.min.js"></script>
<script src="${dailySupport}/js/public/paging/page.js"></script>
<script src="${dailySupport}/js/com/sunny/core/person/person_info_list.js"></script>
<script type="text/javascript">
	$(function() {
		$("#sel").click(function() {
			//var com = $("#con").val();
			//if ("1" == com) {
			//	$("#context").attr("name", "sname");
			//} else if ("2" == com) {
			//	$("#context").attr("name", "sex");
			//}
			$("#con_from").submit();
		});

		//初始化分页插件
		$(".tcdPageCode").createPage({
			pageCount : Math.ceil(<%=total%>/<%=pageSize%>),
			current :<%=pageNum%>,
			backFn : function(p) {
				$("#pageNum").val(p);
				$("#con_from").submit();
			}
		});
	});
</script>

</head>

<body>
	<div style="padding:0px; margin:0px;">
		<ul class="breadcrumb" style="  margin:0px; ">
			<li><a href="#">系统管理</a></li>
			<li>人员管理</li>
		</ul>
	</div>
	<div class="row alert alert-info" style="margin:0px; padding:3px;">
		<form action="${dailySupport}/person/query.do" method="post" class="form-horizontal"
			id="con_from" onkeydown="if(event.keyCode==13)return false;">
			<div class="col-sm-1">条件:</div>
			<div class="col-sm-3">
					<select id="con" class="form-control  input-sm" name="searchType">
						<option value="1" <% if(searchType.equals("1")){%>selected="selected"<%}%>>
							姓名
						</option>
						<option value="2" <% if(searchType.equals("2")){%>selected="selected"<%}%>>
							出生日期
						</option>
					</select>
			</div>
			<div class="col-sm-3">
				<input type="text" id="context" name="searchValue"
					class="form-control input-sm" value="${searchValue}"/>
			</div>
			<input type="button" id="sel" class="btn btn-danger" value="查询" /> <input
				type="button" class="btn btn-success" value="添加"
				onClick="javascript:window.location='${dailySupport}/person/toAdd.do'" />
			<input type="hidden" id="pageNum" name="pageNum" value="1"/>
		</form>
	</div>
	<div class="row" style="padding:15px; padding-top:0px; ">
		<table class="table  table-condensed table-striped">
			<tr>
				<th style="text-align:center">序号</th>
				<th>姓名</th>
				<th>性别</th>
				<th>身份证</th>
				<th>出生日期</th>
				<th>农历/阳历</th>
				<!-- <th>添加时间</th> -->
				<th>操作</th>
			</tr>
			<c:forEach items="${personInfoList}" var="entity" varStatus="status">
				<tr>
					<td style="text-align:center">${(pageNum-1)*pageSize + status.index +1}</td>
					<td>${entity.personName}</td>
					<td>${entity.personGender==0?'男':'女'}</td>
					<td>${entity.idCardNo}</td>
					<td>${entity.birthday}</td>
					<td>${entity.isLunarCalendar==0?'农历':'阳历'}</td>
					<%-- <td><fmt:formatDate value="${entity.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td> --%>
					<td>
					<a href="${dailySupport}/person/toDetail.do?personPid=${entity.personPid}">查看</a>
					<a href="${dailySupport}/person/toEdit.do?personPid=${entity.personPid}">修改</a>
					<a href="javascript:deletePerson('${entity.personPid}')">删除</a>
				</tr>
			</c:forEach>
		</table>
	</div>
	<div id="end">
		<!--分页插件begin-->
		<div class="tcdPageCode"></div>
		<!--分页插件end-->
	</div>
</body>
</html>
